import request from '@/utils/request'

// 查询采购退货列表
export function listRefund(query) {
  return request({
    url: '/purchasing/refund/list',
    method: 'get',
    params: query
  })
}

// 查询采购退货详细
export function getRefund(refundId) {
  return request({
    url: '/purchasing/refund/' + refundId,
    method: 'get'
  })
}

// 查询采购入库单详细
export function changeRefundState(refundId) {
  return request({
    url: '/purchasing/entry/state/' + refundId,
    method: 'get'
  })
}
// 新增采购退货
export function addRefund(data) {
  return request({
    url: '/purchasing/refund',
    method: 'post',
    data: data
  })
}

// 修改采购退货
export function updateRefund(data) {
  return request({
    url: '/purchasing/refund',
    method: 'put',
    data: data
  })
}

// 删除采购退货
export function delRefund(refundId) {
  return request({
    url: '/purchasing/refund/' + refundId,
    method: 'delete'
  })
}
